


package com.UMLife.me.ui;

import javax.microedition.lcdui.Image;
import com.UMLife.me.action.ForgetPswAction;
import de.enough.polish.ui.Container;
import de.enough.polish.ui.Form;
import de.enough.polish.ui.ImageItem;
import de.enough.polish.ui.Item;
import de.enough.polish.ui.StringItem;
import de.enough.polish.ui.TextField;





public class ForgetPswUI
		extends Form
{
	public ForgetPswUI()
	{
		//#style ForgetPswUI
		super(null);
		
		try
		{
			Image logoImage = Image.createImage("/logo.png");
			Image modifyImage = Image.createImage("/modify.png");
			// 这里添加的是要处理的按钮部分，将其作为参数传递到Action中
			this.logo = new ImageItem(null, logoImage, Item.PLAIN, null);
			// #style modifyButton
			this.modifyButton = new ImageItem(null, modifyImage, Item.BUTTON,
					null);
			
		} catch (Exception e)
		{
			// TODO: handle exception
		}
		
		//#style ForgetPswCon
		Container con = new Container(true);
		
		//#style ForgetPswNameItem
		StringItem mailItem = new StringItem(null, "邮箱：", Item.PLAIN);
		//#style ForgetPswNameItem
		StringItem phoneItem = new StringItem(null, "手机号码：", Item.PLAIN);
		//#style ForgetPswNameItem
		StringItem pswItem = new StringItem(null, "新密码：", Item.PLAIN);
		//#style ForgetPswNameItem
		StringItem newPswItem = new StringItem(null, "确认密码：", Item.PLAIN);
		//#style ForgetPswtextField
		this.mail = new TextField(null, "邮箱/昵称", 15, TextField.ANY);
		//#style ForgetPswtextField
		this.newPsw = new TextField(null, "", 15, TextField.PASSWORD);
		//#style ForgetPswtextField
		this.phone = new TextField(null, "", 11, TextField.DECIMAL);
		//#style ForgetPswtextField
		this.confirmPsw = new TextField(null, "", 15, TextField.PASSWORD);
		
		con.add(mailItem);
		con.add(this.mail);
		con.add(phoneItem);
		con.add(this.phone);
		con.add(pswItem);
		con.add(this.newPsw);
		con.add(newPswItem);
		con.add(this.confirmPsw);
		con.add(this.modifyButton);
		this.append(this.logo);
		this.append(con);
		this.setCommandListener(new ForgetPswAction(this, this.modifyButton));
		
	}
	
	public String getConfirmPsw()
	{
		// TODO
		return this.confirmPsw.toString();
	}
	
	public String getMail()
	{
		// TODO
		return this.mail.toString();
	}
	
	public String getNewPsw()
	{
		// TODO
		return this.newPsw.toString();
	}
	
	public String getPhone()
	{
		// TODO
		return this.phone.toString();
	}
	
	private TextField	confirmPsw;
	
	private ImageItem	logo;
	
	private TextField	mail;
	
	private ImageItem	modifyButton;
	
	private TextField	newPsw;
	
	private TextField	phone;
}
